﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace LeMigue.Framework.Utils
{
    public static class CurrentContext
    {
        //System.Web.HttpContext.Current.Items["listaSessaoProvaColegiada"]
        public static void Set<T>(string key, T valor)
        {
            HttpContext.Current.Items[key] = valor;
        }
        public static void Remove(string key)
        {
            if (HttpContext.Current.Items[key] != null)
                HttpContext.Current.Items.Remove(key);
        }
        public static T Get<T>(string key, T padrao)
        {
            if (HttpContext.Current.Items[key] == null)
                return padrao;

            return (T)HttpContext.Current.Items[key];
        }
    }
}
